<?
require("config.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Acuity World</title>
<link href="images/css.css" rel="stylesheet" type="text/css">
<body bgcolor="7DA7D9">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="13"><img src="images/c1.gif" width="13" height="37"></td>
          <td background="images/c5.gif" class="boxTitle">e-mail to friend </td>
          <td width="13"><img src="images/c2.gif" width="13" height="37"></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="2" bgcolor="B1CAE8"><img src="images/shim.gif" width="2" height="1"></td>
          <td align="center"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td bgcolor="F78D83"><img src="images/shim.gif" width="1" height="2"></td>
              </tr>
            </table>
            <p>
              <script language="JavaScript"> 
<!-- 
function checkForm1(theform) { 

if (theform.To.value=="") { 
    theform.To.focus(); 
    alert("Whom you want to send mail ?"); 
    return false; } 

if (validate_email(theform.ToEmail.value)== false){ 
    theform.ToEmail.focus(); 
    alert("Invalid Email."); 
    return false; } 



if (theform.From.value=="") { 
    theform.From.focus(); 
    alert("Please enter your name."); 
    return false; } 

if (validate_email(theform.FromEmail.value)== false){ 
    theform.FromEmail.focus(); 
    alert("Invalid Email."); 
    return false; } 

}


function validate_email(email) 
{ 
  if (!validate_ascii_data (email)) { 
    return false 
  } 

  var invalidChars = "\"|&;<>!*\'\\"   ; 

  for (var i = 0; i < invalidChars.length; i++) { 
    if (email.indexOf(invalidChars.charAt(i)) != -1) { 
      return false; 
    } 
  } 
  
  if (email.indexOf("@")==-1){ 
     return false; 
  } 
         
  if (email.indexOf(" ") != -1){ 
    return false; 
  } 

  if (window.RegExp) { 

    var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)"; 
    var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"; 
     
    var reg1 = new RegExp (reg1str); 
    var reg2 = new RegExp (reg2str); 
    if (reg1.test(email) || !reg2.test(email)) { 
      return false; 
    } 
  } 
  return true; 
} 

function validate_ascii_data(urstr) 
{ 
  var i; var result; 
  for(i=0; i<urstr.length; i++) { 
    if((urstr.charAt(i) < " ") || (urstr.charAt(i) > "~")) 
      return false; 
  } 
  return true; 
} 
//--> 
</script>
            </p>
            <form name="form1" method="post" action="email1.php" onSubmit="return checkForm1(this)">
              <table width="100%" border="0" cellspacing="1" cellpadding="2">
                <tr> 
                  <td width="7%">&nbsp;</td>
                  <td width="93%"> <input type="text" name="To" size="20" class="text"> 
                    <font color="red">*</font>To</td>
                </tr>
                <tr> 
                  <td width="7%">&nbsp;</td>
                  <td width="93%"> <input type="text" name="ToEmail" size="20" class="text"> 
                    <font color="red">*</font>To Email</td>
                </tr>
                <tr> 
                  <td width="7%">&nbsp;</td>
                  <td width="93%"> <input type="text" name="From" size="20" class="text"> 
                    <font color="red">*</font>From</td>
                </tr>
                <tr> 
                  <td width="7%">&nbsp;</td>
                  <td width="93%"> <input type="text" name="FromEmail" size="20" class="text"> 
                    <font color="red">*</font>From Email</td>
                </tr>
                <tr> 
                  <td width="7%">&nbsp;</td>
                  <td width="93%"> <textarea name="Remark" cols="40" rows="8" class="text"></textarea>
                    Your Message<font size="1">&nbsp;</font>                
					
					<input type="hidden" name="id" value="<?=$id?>">
                <input type="hidden" name="p" value="<?=$p?>">
</td>
                </tr>
                <tr> 
                  <td width="7%" height="47">&nbsp;</td>
                  <td><input type="submit" name="Submit3" value="Send" class="button"></td>
                </tr>
              </table>
            </form>
            <p>&nbsp; </p></td>
          <td width="2" bgcolor="B1CAE8"><img src="images/shim.gif" width="2" height="1"></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="6"><img src="images/c3.gif" width="6" height="6"></td>
          <td background="images/c7.gif"><img src="images/c7.gif" width="6" height="6"></td>
          <td width="6"><img src="images/c4.gif" width="6" height="6"></td>
        </tr>
      </table></td>
  </tr>
</table>

</body>
</html>
